import React, {Component} from 'react';
import {inject, observer} from "mobx-react";
import {List} from "antd-mobile";
import {UserCenterStore} from "../store";
import history from "../../../util/router/history";

interface ICommonFunctionProps {
  userCenterStore?: UserCenterStore | any;
}

@inject('userCenterStore')
@observer
export default class CommonFunction extends Component<ICommonFunctionProps, any> {

  render() {
    return (
      <>
        <List>
          <List.Item
            thumb={require("../../../util-biz/icon-img/basic-info.png")}
            onClick={() => history.push("/user-info")}
            arrow="horizontal"
          >
            修改基本信息
          </List.Item>
          <List.Item
            thumb={require("../../../util-biz/icon-img/safe.png")}
            arrow="horizontal"
            onClick={() => history.push(`/user-password/${this.props.userCenterStore.userInfo.userId}`)}
          >
            修改登录密码
          </List.Item>
        </List>
      </>
    );
  }

}
